<?php
return array(
    'router' => array(
        'routes' => array(
            'system' => array(
                'type'    => 'Literal',
                'options' => array(
                    'route'    => '/system',
                    'defaults' => array(
                        '__NAMESPACE__' => 'Administrator\Controller',
                        'controller'    => 'Login',
                        'action'        => 'index',
                    ),
                ),
            		
               'may_terminate' => true,
                'child_routes' => array(
                    'sub' => array(
                        'type'    => 'Segment',
                        'options' => array(
                            'route'    => '[/:action][/:id]',
                            'constraints' => array(
                                'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
                            		'id' => '[0-9,]+',
                            ),
                            'defaults' => array(
                            		'controller'    => 'Login',
                            		'action'        => 'index',
                            ),
                        ),
                    ), 
                		'listuser' => array(
                				'type'    => 'Literal',
                				'options' => array(
                						'route'    => '/listUser',
                						'defaults' => array(
                								'__NAMESPACE__' => 'Administrator\Controller',
                								'controller'    => 'Login',
                								'action'        => 'listuser',
                						),
                				),
                		),
                		
                		'adduser' => array(
                				'type'    => 'Literal',
                				'options' => array(
                						'route'    => '/addUser',
                						'defaults' => array(
                								'__NAMESPACE__' => 'Administrator\Controller',
                								'controller'    => 'Login',
                								'action'        => 'add',
                						),
                				),
                		),
                		'resource' => array(
                				'type'    => 'Literal',
                				'options' => array(
                						'route'    => '/resource',
                						'defaults' => array(
                								'__NAMESPACE__' => 'Administrator\Controller',
                								'controller'    => 'Login',
                								'action'        => 'resource',
                						),
                				),
                		),
                		
                		'addresource' => array(
                				'type'    => 'Literal',
                				'options' => array(
                						'route'    => '/addResource',
                						'defaults' => array(
                								'__NAMESPACE__' => 'Administrator\Controller',
                								'controller'    => 'Login',
                								'action'        => 'addresource',
                						),
                				),
                		),
                ),    
            		  		
            ),
   
        		'user_edit' => array(
        				'type' => 'Regex',
        				'options' => array(
        						'regex' => '/system/edit/(?<id>[\/a-zA-Z0-9_-]+)(\.(?<format>(json|html|xml|rss)))?',
        						'spec' => '/system/edit/%id%.%format%',
        						'defaults' => array(
        								'controller' => 'Administrator\Controller\Login',
        								'action'     => 'edit',
        								'format'     => 'html',
        						),
        				),
        		),

        		/* 'logout' => array(
        				'type'    => 'Literal',
        				'options' => array(
        						'route'    => '/logout',
        						'defaults' => array(
        								'__NAMESPACE__' => 'Administrator\Controller',
        								'controller'    => 'Login',
        								'action'        => 'logout',
        						),
        				),
        		),
        		
        		'index' => array(
        				'type'    => 'Literal',
        				'options' => array(
        						'route'    => '/index',
        						'defaults' => array(
        								'__NAMESPACE__' => 'Administrator\Controller',
        								'controller'    => 'Index',
        								'action'        => 'index',
        						),
        				),
        		),
        		
        		'login' => array(
        				'type'    => 'segment',
        				'options' => array(
        						'route'       => '/login[/:action][/:id]',
        						'constraints' => array(
        								'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
        								'id' => '[0-9]+',
        						),
        						'defaults' => array(
        								'controller' => 'login',
        								'action'     => 'index',
        						),
        				)
        		), */
        		
        		
        ),
    ),
    'service_manager' => array(
        'factories' => array(
            'translator' => 'Zend\I18n\Translator\TranslatorServiceFactory',
        ),
    ),
    'translator' => array(
        'locale' => 'en_US',
        'translation_file_patterns' => array(
            array(
                'type'     => 'gettext',
                'base_dir' => __DIR__ . '/../language',
                'pattern'  => '%s.mo',
            ),
        ),
    ),
    'controllers' => array(
        'invokables' => array(
        	'Administrator\Controller\Login' => 'Administrator\Controller\LoginController',
        ),
    ),
    'view_manager' => array(
        'display_not_found_reason' => true,
        'display_exceptions'       => true,
        'doctype'                  => 'HTML5',
        'not_found_template'       => 'error/404',
        'exception_template'       => 'error/index',
        'template_map' => array(
            'layout/layout'           => TEMPALATE_PATH . '/administrator/index.phtml',
        	'layout/backend'          => TEMPALATE_PATH . '/backend/index.phtml',
            'error/404'               => __DIR__ . '/../view/error/404.phtml',
            'error/index'             => __DIR__ . '/../view/error/index.phtml',
        	'layout/login'           => TEMPALATE_PATH . '/administrator/login.phtml',
        ),
        'template_path_stack' => array(
            __DIR__ . '/../view',
        ),
    ),
);
